<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<link rel="stylesheet" type="text/css" href="/wc/css/common.css" />
	<link rel="stylesheet" type="text/css" href="/wc/css/form.css" />
	<script type="text/javascript" src="/wc/js/jquery-1.11.2.min.js"></script>
	<script type="text/javascript" src="/wc/js/underscore.js"></script>
	<script type="text/javascript" src="/wc/js/pinchzoom.js"></script>
	<title>芝士妈妈在线</title>
</head>
<body>
	<div class="wrapper">
			<h2>医生注册</h2>
			<section class="flex-wrapper flex-align-center special">
				<label>姓名：</label>
				<p class="flex-1">
					<input type="text" id="real_name" name="real_name" value="" data-message="医生姓名不能为空" />
				</p>
			</section>
			<section class="flex-wrapper flex-align-center special">
				<label>手机号：</label>
				<p class="flex-1">
					<input type="tel" id="mobile" name="mobile" value="" data-message="医生手机号不能为空" />
				</p>
			</section>
			<button type="submit"  id="button_zc" class="btn btn-red">注册</button>
	</div>
	<script src="/wc/js/common.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function () {

			$("#button_zc").click(function (e) {
				e.preventDefault();
				zsmm.isValidated = true;
				validateInput("real_name");
				validateInput("mobile");
				validatePhone("mobile");
				if (!zsmm.isValidated) return false;
				var mobile = $("#mobile").val();
				var real_name = $("#real_name").val();
				$.ajax({
					url: "/regdoctor/save",
					data: { mobile: mobile, real_name: real_name },
					type: "post",
					dataType: "json",
					success: function (msg) {
						if (msg.error == 1) {
							zsmm.Toast.New("医生注册成功");
							//清空表单数据
							$("#mobile").val("");
							$("#real_name").val("");
						}
						else {
							zsmm.Toast.New(msg.message);
						}
					}
				});
			});

		});
	</script>
</body>
</html>
